package com.steven.im.ui.fragment;

import android.content.Intent;
import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import com.steven.im.App;
import com.steven.im.R;
import com.steven.im.base.BaseFragment;
import com.steven.im.net.Url;
import com.steven.im.ui.activity.IMMSGSettingActivity;
import com.steven.im.ui.activity.IMMineInfoActivity;
import com.steven.im.ui.activity.IMMyQRCodeActivity;
import com.steven.im.ui.activity.IMPrivacyActivity;
import com.steven.im.ui.activity.IMSafeSettingActivity;
import com.steven.im.ui.activity.ImLoginActivity;
import com.steven.im.ui.activity.MainActivity;
import com.steven.im.ui.activity.WebActivity;
import com.steven.im.utils.DataCheckUtils;
import com.steven.im.utils.ScreenUtil;
import com.steven.im.utils.ToastUtil;

import butterknife.BindView;
import butterknife.OnClick;

public class IMAccountFragment extends BaseFragment {
    @BindView(R.id.view_status_bar_place)
    View statusBarPlace;

    @Override
    public View setContentView(LayoutInflater inflater) {
        return inflater.inflate(R.layout.fragment_im_account, null);
    }

    @Override
    public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
        super.onViewCreated(view, savedInstanceState);
        ViewGroup.LayoutParams params = statusBarPlace.getLayoutParams();
        params.height = ScreenUtil.getStatusBarHeight(getContext());
        statusBarPlace.setLayoutParams(params);
    }

    @OnClick({R.id.rl_mine, R.id.im_rlNotice, R.id.im_rlPrivacy, R.id.im_rlSafe, R.id.im_rlShare, R.id.im_rlPing, R.id.im_rlAbout})
    public void onViewClicked(View view) {
        if (ScreenUtil.isFastClick()) {
            return;
        }
        switch (view.getId()) {
            case R.id.rl_mine://个人信息
                startActivity(new Intent(getActivity(), IMMineInfoActivity.class));
                break;
            case R.id.im_rlNotice://消息设置
                startActivity(new Intent(getActivity(), IMMSGSettingActivity.class));
                break;
            case R.id.im_rlPrivacy://隐私
                startActivity(new Intent(getActivity(), IMPrivacyActivity.class));
                break;
            case R.id.im_rlSafe://安全设置
                startActivity(new Intent(getActivity(), IMSafeSettingActivity.class));
                break;
            case R.id.im_rlShare://分享
                startActivity(new Intent(getActivity(), IMMyQRCodeActivity.class));
                break;
            case R.id.im_rlPing://好评
                break;
            case R.id.im_rlAbout://关于
                break;
        }
    }
}
